#!/usr/bin/env python
import re

# PATTERN = r'商品编号：(.*?)'

parameter_list = ['商品名称：【官方正品】山特SANTAKC6K/C10K在线式不间断电源ups带稳压内置蓄电池机房断电延时后备电 C6K在线式6000VA/5400W',
                  '商品编号：23000533238', '店铺： ', '商品毛重：68.0kg', '类别：在线互动式全自动稳压功能']

battery_type = re.compile(r'商品名称：(.*?)')
battery_series = re.compile(r'商品编号：(.*?)')

# def find_item(re_str, parameterlist):
#     pattern = re.compile(re_str)
#     for item in parameterlist:
#         m = pattern.search(item)
#         if m:
#             return item
#         else:
#             return ''


if __name__ == '__main__':
    # parameter = find_item(PATTERN, parameter_list)
    # print(parameter)
    # pattern = re.compile(r'商品编号：(.*?)')
    # for parameter in parameter_list:
    #     m = pattern.search(parameter)
    #     if m:
    #         print(parameter)

    for parameter in parameter_list:
        m = battery_type.search(parameter)
        if m:
            print("type:" + parameter)
        n = battery_series.search(parameter)
        if n:
            print("series:" + parameter)



